#ifndef INPUT_RING_BUFFER_H
#define INPUT_RING_BUFFER_H
#include "stdint.h"
#include "light_input_system.h"
#include "cdn_key.h"

#define OTHER_BUFFER_SIZE 10        // 其它环形缓冲区的大小
#define KEY_BUFFER_SIZE  1          // 按键缓冲区的大小

typedef struct
{
  InputEvent buffer[OTHER_BUFFER_SIZE];   //其它缓冲区空间
  volatile uint32_t other_pW;             //其它写地址
  volatile uint32_t other_pR;             //其它读地址
} InputEventBuffer;

typedef struct
{
    KeyInputEvent key_buffer[KEY_BUFFER_SIZE];    //按键缓冲区空间
    volatile uint8_t key_Write;                   //1:按键有值写入，0:没有按键输入
} KeyInputBuffer;

uint8_t GetOtherInputEvent(PInputEvent ptInputEvent);
uint8_t PutKeyInputEvent(PKeyInputEvent ptKeyEvent);
uint8_t PutOtherInputEvent(PInputEvent ptInputEvent);
uint8_t GetKeyInputEvent(PKeyInputEvent ptKeyEvent);

#endif
